package com.cksecurity.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.cksecurity.util.PageBean;

public interface GenericDao {

    <T> T getObject(Class<T> t, Serializable id);

    <T> List<T> getAll(Class<T> t);

    <T> List<T> findByHql(String hql, Class<T> t, Map<String, Object> params);

    <T> List<T> findByHqlPageable(String hql, Class<T> t, Map<String, Object> params, PageBean pageBean);

    <T> List<T> findByHql(String hql, Class<T> t, Object... params);

    <T> List<T> findBySql(String hql, Class<T> t, Map<String, Object> params);

    <T> List<T> findBySqlPageable(String hql, Class<T> t, Map<String, Object> params, PageBean pageBean);

    <T> List<T> findBySql(String hql, Class<T> t, Object... params);
    
    <T> void saveObject(Class<T> t);
    <T> void updateObject(Class<T> t);
    <T> void saveOrUpdateObject(Class<T> t);

}
